﻿using UnityEngine;
using System.Collections;
using System;
public enum MoveState
{
    NONE,
    Idle,
    MoveLeft,
    MoveRight,
    MoveDown,
    MoveUp
}

public class GameInputManager
{
    public event Action<KeyCode,bool> InputEvents;

    public void Update()
    {
        if (InputEvents == null) return;

        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            InputEvents(KeyCode.RightArrow,true);
        }
        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            InputEvents(KeyCode.LeftArrow, true);
        }
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            InputEvents(KeyCode.UpArrow, true);
        }
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            InputEvents(KeyCode.DownArrow, true);
        }
        if (Input.GetKeyDown(KeyCode.X))
        {
            InputEvents(KeyCode.X, true);
        }
        if (Input.GetKeyDown(KeyCode.Z))
        {
            InputEvents(KeyCode.Z,true);
        }


        if (Input.GetKeyUp(KeyCode.RightArrow))
        {
            InputEvents(KeyCode.RightArrow, false);
        }
        if (Input.GetKeyUp(KeyCode.LeftArrow))
        {
            InputEvents(KeyCode.LeftArrow, false);
        }
        if (Input.GetKeyUp(KeyCode.UpArrow))
        {
            InputEvents(KeyCode.UpArrow, false);
        }
        if (Input.GetKeyUp(KeyCode.DownArrow))
        {
            InputEvents(KeyCode.DownArrow, false);
        }
        if (Input.GetKeyUp(KeyCode.X))
        {
            InputEvents(KeyCode.X, false);
        }


    }
}
